#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int fib(int x)
{
	//f(n) = f(n-1)+f(n-2)  f(0) = 0 f(1)= 1
	int result = 0;//n
	int pre_result = 1;//n -1
	int next_pre_result = 0;//n-2
	if (x > 1)
	{
		int i = 0;
		for (i = 1; i < x; i++)
		{
			result = pre_result + next_pre_result;
			next_pre_result = pre_result;
			pre_result = result;
		}
	}
	return result;
}

int main()
{
	int n = 0;
	while (scanf("%d", &n) != EOF)
	{
		printf("%d\n", fib(n));
	}

	return 0;
}